Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trailing comma in implicit tuples in destructuring #59

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

fredrikekre
Copy link
Owner

This patch fixes the usage of trailing commas in implicit tuples when used in destructuring assignment, e.g. x, = z. In this context the trailing comma is needed to preserve the tuple node, which is different from e.g. implicit tuples in do-blocks. A trailing comma is allowed (e.g. preserved from the source) for multi-item implicit tuples so that e.g. x, y, = z can be used to signal that z contains more than two items. Closes #58.

This patch fixes the usage of trailing commas in implicit tuples when
used in destructuring assignment, e.g. `x, = z`. In this context the
trailing comma is needed to preserve the tuple node, which is different
from e.g. implicit tuples in `do`-blocks. A trailing comma is allowed
(e.g. preserved from the source) for multi-item implicit tuples so that
e.g. `x, y, = z` can be used to signal that z contains more than two
items. Closes #58.
@fredrikekre fredrikekre merged commit be162ee into master Sep 9, 2024
16 checks passed
@fredrikekre fredrikekre deleted the fe/single-item-implicit-tuple branch September 9, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runic breaks unpacking of only the first element of a tuple
1 participant